import vue from '@vitejs/plugin-vue'
import babel from 'vite-plugin-babel';
import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus'

import createSvgIcon from './svg-icon'

export default function createVitePlugins( viteEnv, isBuild = false ) {
  const vitePlugins = [vue(), vueSetupExtend()]
  vitePlugins.push( createSvgIcon( isBuild ))
  if ( 'production' === viteEnv ) {
    vitePlugins.push( babel())
  }
  // console.log( vitePlugins );
  return vitePlugins
}
